(1) Field of the Invention
The present invention relates to a debugging system and method for a multitask environment, and in particular to a technique for, in an environment where a plurality of tasks access a same memory, controlling such that operations of tasks that access the memory are not affected when recording content of the memory is rewritten as necessary.
(2) Description of the Related Art
With advances in the functionality and performance of information appliances, automobile control devices, and the like in recent years, software embedded in such systems is becoming larger in scale and more complicated. This has resulted in increased use of operating systems (OSs) in the field of embedded software, and the majority of such OSs are multitask OSs.
Using a multitask OS enables different processing to be performed simultaneously in parallel. To achieve this, the processing time of a microcomputer is divided and the divided processing time is allocated sequentially a plurality of application programs, thus giving the impression that different processing is being performed simultaneously.
Application programs that operate on a multitask OS are processed in executable units that are called tasks, or may be called processes depending on the OS. A plurality of executable units that belong to a same process and share microcomputer resources are called a thread. In the present invention, the executable units that operate in a multitask environment are called tasks, unless a particular distinction is being made between an executable unit being a process or a thread.
Although a plurality of tasks that operate in a multitask environment generally have independent memory resources when run by a microcomputer, there are certain conditions under which the tasks share memory resources.
In the multitask OS called Linux, if one application program is run as a plurality of processes, the same memory resources are shared when one process is run as a plurality of threads.
When the microcomputer uses a memory management unit (MMU), Linux uses a virtual storage function, and tasks operate in a logical address space. When one application program is run as a plurality of processes, each process operates in a different logical address space, but physical address space is shared. Furthermore, when one process is run as a plurality of threads, the threads run in the same logical address space and share physical address space.
However, when a plurality of tasks in a multitask environment share memory resources in this way, operations of tasks are affected when processing such as break setting and rewriting of recording content of the memory is performed with respect to another task that is the target of debugging by a debugger.
For instance, a failure may occur in the operations of a running task that is not a target of debugging, due to a break stop occurring based on a break setting set for another task and an instruction rewritten for debugging being executed.
One technique for preventing such failures is disclosed by Japanese Patent Application Publication No. 2000-172532. With this technique, a break stop based on a break setting for a task that is a target of debugging is made to occur only for that task. For tasks that are not a target of debugging, processing is performed to make the break setting in the memory shared with the debugging target task invalid, and execution of the tasks that are not a target of debugging is resumed after this processing.
This technique suppresses unnecessary breaks in running tasks that are not a target of debugging, thus enabling the tasks to run normally, and improving debugging efficiency in a multitask environment.
However, with the described technique, when a break occurs in a task that is not a target of debugging, it is necessary to re-run the task. This is problematic in that it is a hindrance to real-time operation, in other words operation in a set time requirement, of tasks that are not a target of debugging.